package com.qf.ts.platform.front.feign;

import com.qf.ts.platform.front.feign.impl.CarSourceSearchServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author xianchang
 */
@FeignClient(value = "ts-search", path = "/carSoureSearch", fallback = CarSourceSearchServiceFallback.class)
public interface CarSourceSearchServiceClient {

    @GetMapping("/createIndex")
    String createIndexAndType();

    /**
     * 注意:
     * 在进行远程调用时,接口定时的地方,参数必须写完整!
     * 尤其是@PathVariable和@RequestParam("json")
     */
    @PostMapping("/addDocument")
    String addDocument(@RequestParam("json") String json);

    @GetMapping("/count")
    long searchCount(@RequestParam("json") String json);

    @GetMapping("/comprehensive")
    List<Map> compreSearch(@RequestParam("json") String json);

    @GetMapping("/deweight")
    List<Map> deweightSearch(@RequestParam("json") String json);

    @GetMapping("/hight")
    List<Map> hightSearch(@RequestParam("json") String json);

}
